LNMP环境
撰写时间: 2018-12-10 总共: 814 字 转载请注明: BY-SA 4.0(除特别声明或转载文章外)
LNMP环境
Linux & Nginx & MySQL & PHP
该Linux 为 centos6.5版本
安装nginx
移除配置文件/etc/nginx/conf.d/default.conf对IPv6的监听
vim /etc/nginx/conf.d/default.conf
# 然后注释掉
#listen [: :]:80
安装mysql
wget 'http://repo.mysql.com/mysql80-community-release-el7-2.noarch.rpm'
安装php
yum install php-fpm php-mysql -y
service php-fpm start
# 安装wordpress
yum install wordpress -y
可以在usr/share/wordpress/看见源代码
创建数据库
CREATE DATABASE wordpress;
进入WordPress修改配置文件,同步数据库信息数据库名称,用户名,密码
配置nginx
创建一个
wordpress.conf
# wordpress.conf
server {
listen 80;
root /usr/share/wordpress;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php index.php;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}